﻿@model CommentsViewModel

@if (User.Identity.IsAuthenticated)
{
    <div id="commentResponse">
        <h4>
            <span class="glyphicon glyphicon-comment"></span> Tilføj en kommentar
        </h4>
        <div class="form-group">
            <textarea class="form-control" name="text" cols="80" rows="2"></textarea>
            <br>
            <button class="btn btn-default ajaxPost" data-id="@Model.Id" data-uuid="@Model.Uuid" data-type="@Model.CommentType">besvar</button>
        </div>
    </div>
}
else
{
    <div class="alert alert-info">@Html.ActionLink("Log ind", "Login", "Account") for at kommentere.</div>
}

@if (Model.Comments != null)
{
    <div class="comments">
        @foreach (Comment c in Model.Comments)
        {
            @Html.Partial("_comment", c)
        }
    </div>
}